package businesslogic.courseselectionbl.Strategy;

import po.CourseClassification;

public class StrategyConfiguration {
	static int NUM_OF_TYPE = 10;
	
	static SelectStrategy list[] = new SelectStrategy[NUM_OF_TYPE];
	
	static {
			list[CourseClassification.FENCENGCITONGXIUKE.ordinal()] 
					= new CrossSelectStrategy(CourseClassification.FENCENGCITONGXIUKE, 2);
			list[CourseClassification.GONGGONGXUANXIUKE.ordinal()]
					= new PreSelectStrategy(CourseClassification.GONGGONGXUANXIUKE, 2);
			list[CourseClassification.TONGSHIJIAOYUKE.ordinal()]
					= new PreSelectStrategy(CourseClassification.TONGSHIJIAOYUKE, 4);
			list[CourseClassification.ZHUANYEKE.ordinal()]
					= new CrossSelectStrategy(CourseClassification.ZHUANYEKE, 2);
			list[CourseClassification.ZHUANYEXUANXIUKE.ordinal()]
					= new DirectSelectStrategy(CourseClassification.ZHUANYEXUANXIUKE, 2);
			list[CourseClassification.BIYELUNWEN.ordinal()]
					= null;
			list[CourseClassification.JUNSHIKE.ordinal()]
					= null;
			list[CourseClassification.SIXIANGZHENGZHILILUNKE.ordinal()]
					= null;
	}
	
	
	public static SelectStrategy getSelectStrategy(CourseClassification type) {
		return list[type.ordinal()];
	}
	
	public static DrawStrategy getDrawStrategy(CourseClassification type) {
		int draw[] = {0, 0, 0, 0, 0, 1, 1, 1};
		DrawStrategy strategy[] = {new RandomDrawStrategy(), new PriorityDrawStrategy()};
		return strategy[draw[type.ordinal()]];
	}

}
